package com.gree.flowable.app.tools.pattern;

import com.gree.flowable.app.pojo.ex.FlowElementEx;
import com.gree.flowable.app.pojo.vo.NextElementVO;
import org.flowable.bpmn.model.FlowElement;

import java.util.ArrayList;
import java.util.List;

public class OneAllotStrategy implements AllotNodeVoStrategy<FlowElementEx> {

    @Override
    public List<NextElementVO> pack(FlowElementEx data) {
        List<NextElementVO> list = new ArrayList<>();
        NextElementVO vo = new NextElementVO();
        FlowElement flowElement = data.getFlowElement();
        vo.setName(flowElement.getName());
        vo.setElementId(flowElement.getId());
        vo.setDocumentation(flowElement.getDocumentation());
        vo.setFlowName(data.getFlowName());
        vo.setExcutionType(data.getExcutionType());
        list.add(vo);
        return list;
    }
}
